package Java.BlackHorse.IO.ObjectStream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class IODemo1 {
    public static void main(String[] args) throws IOException {
//        创建对象
        Student stu = new Student("张三",19);
//        创建序列化流的对象
        ObjectOutputStream ooj = new ObjectOutputStream(new FileOutputStream("IO\\ObjectStream\\student.txt"));
//       写出数据
        ooj.writeObject(stu);
//        释放资源
        ooj.close();
    }
}
